package com.jrx.anytxn.reporting.mapper.ext;


import com.jrx.anytxn.reporting.entity.AmRepaymentPlanInfo;
import com.jrx.anytxn.reporting.entity.CmInteCoLonInfoCi;
import com.jrx.anytxn.reporting.entity.CmInteCoLonRepayDtlCi;
import com.jrx.anytxn.reporting.entity.CmInteCoLonRepayPlanCi;
import com.jrx.anytxn.reporting.entity.LoanAcctVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ExtFtpInteCoLonMapper {

    /**
     * 删除大数据供数(借据维度)-贷款信息
     *
     * @param today
     */
    void deleteLonInfoCiByBusinessDate(@Param("today") Date today);

    /**
     * 删除大数据供数(借据维度)-还款详细
     *
     * @param today
     */
    void deleteLonRepayDtlCiByBusinessDate(@Param("today") Date today);

    /**
     * 删除大数据供数(借据维度)-还款计划
     *
     * @param today
     */
    void deleteLonRepayPlanCiByBusinessDate(@Param("today") Date today);

    void insertSelectiveRepayPlanCi(CmInteCoLonRepayPlanCi item);

    void insertSelectiveRepayDtlCi(CmInteCoLonRepayDtlCi item);

    void insertSelectiveLonInfoCi(CmInteCoLonInfoCi item);

    /**
     * 获取还款计划
     * @param payOffStatus
     * @param statusList
     * @param loanType
     * @param today
     * @return
     */
    List<AmRepaymentPlanInfo> getAllRepayPlanCi(@Param("payOffStatus") List<String> payOffStatus, @Param("statusList") List<String> statusList, @Param("loanType") String loanType, @Param("today") Date today);

    /**
     * 贷款还款明细
     * @param today
     * @return
     */
    List<CmInteCoLonRepayDtlCi> getAllRepayDtlCi(@Param("today") Date today);

    /**
     * 获取贷款信息
     * @param payOffStatus
     * @param statusList
     * @param loanType
     * @param today
     * @return
     */
    List<CmInteCoLonInfoCi> getAllLoanInfoCi(@Param("payOffStatus") List<String> payOffStatus, @Param("accountStatus") List<String> statusList, @Param("loanType") String loanType, @Param("today") Date today);

    /**
     * 查询today生成贷款信息数量(借据维度)
     * @param today
     * @return
     */
    int getTotalLoanCiNum(@Param("today") Date today);

    /**
     * 查询today生成还款详情数量(借据维度)
     * @param today
     * @return
     */
    int getTotalRepayDtlNum(@Param("today") Date today);

    /**
     * 查询today生成还款计划数量(借据维度)
     * @param today
     * @return
     */
    int getTotalRepayPlanNum(@Param("today") Date today);

    /**
     * 查询余额为0的数据
     * @param tenantId
     * @param businessDate
     * @param accountStatus
     * @return
     */
    List<LoanAcctVo> getLoanAcctByZero(@Param("tenantId") String tenantId, @Param("businessDate") Date businessDate, @Param("accountStatus") List<String> accountStatus);
}